#include <QApplication>
#include "openglwidget.h"
#include "SkyboxWidget.h"
#include <QDialog>


int main(int argc, char *argv[]) {
    QCoreApplication::addLibraryPath("/Users/gxznmac/Qt5.9.1-bk/5.9.1/clang_64/plugins");
    QApplication app(argc, argv);
    
    //OpenGLWidget window;
    
    
    QOpenGLSkyboxWidget window(
        "/Users/gxznmac/Desktop/qt-gldemo/img/front.jpg",
        "/Users/gxznmac/Desktop/qt-gldemo/img/back.jpg",
        "/Users/gxznmac/Desktop/qt-gldemo/img/top.jpg",
        "/Users/gxznmac/Desktop/qt-gldemo/img/bottom.jpg",
        "/Users/gxznmac/Desktop/qt-gldemo/img/left.jpg",
        "/Users/gxznmac/Desktop/qt-gldemo/img/right.jpg"
    );

    QSurfaceFormat format;
    format.setRenderableType(QSurfaceFormat::OpenGL);
    format.setDepthBufferSize(24);
    format.setStencilBufferSize(8);
    format.setVersion(4, 1);
    format.setProfile(QSurfaceFormat::CoreProfile);
    QSurfaceFormat::setDefaultFormat(format);
    window.setFormat(format); // must be called before the widget or its parent window gets shown

    window.resize(800, 600);
 
    window.show();
    
    return app.exec();
}
